UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6D55Ht4wHKfzCGAvKBHAN7Zw4z+HiOmVB6WVFxJ+0Y0='
WHERE
key_id = 'ef06a98f4d0c0f93884ef5ba13efc5b4a660334adeea50a57291e356b5bd0b00'
AND (
token = '6D55Ht4wHKfzCGAvKBHAN7Zw4z+HiOmVB6WVFxJ+0Y0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)