UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2EFnrGZMWY2+UQWmW1/SMXk4rRid6yG+MEsu707QRak='
WHERE
key_id = 'a2c9ae9223e73493cd4773886b34fd4a20e0464db3674b8a93682f65316e83d6'
AND (
token = '2EFnrGZMWY2+UQWmW1/SMXk4rRid6yG+MEsu707QRak='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)