UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5gXzKUz1OHQttSFLvWTNYhPxP15g1M8TRMie2/t5u2I='
WHERE
key_id = '372eafbf0d2250fc256871a34327ff95ebbe6b89ec1f44b3920892d58c5e188e'
AND (
token = '5gXzKUz1OHQttSFLvWTNYhPxP15g1M8TRMie2/t5u2I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)