UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8aFWlAvyZmTRsdA9Iq2Z3DEktRS1AsWoqHA8Z7hePWY='
WHERE
key_id = '3fd029d0b7cf8b01a8de3c14637ee79623eae5c71d8ccb313f65a5d27a129c87'
AND (
token = '8aFWlAvyZmTRsdA9Iq2Z3DEktRS1AsWoqHA8Z7hePWY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)