UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1ukZ8XQu5VQvr1/nlJrIgVHmVoXMMbse+Us0T+85pEk='
WHERE
key_id = '36f21eb8a733b22fd64e8b0b102d43a6b8beb046e3c5a3f6c3e4c74e4eb86271'
AND (
token = '1ukZ8XQu5VQvr1/nlJrIgVHmVoXMMbse+Us0T+85pEk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)