UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zwUjc6KyldFMNn4NgSLFXRvfXbXpiVh8bFuiiOvbL0E='
WHERE
key_id = '041937cd6ade64fa2e1125e0c4be0614a8c80726add933886537b0e7d125a7d8'
AND (
token = 'zwUjc6KyldFMNn4NgSLFXRvfXbXpiVh8bFuiiOvbL0E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)