UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1uHqnKI2IInOUFJUAI+URej+yGkS+PJ7xEtDjGRlzTw='
WHERE
key_id = '0e0fe0e7390575a2a962491e8c89552679216aa55a8c47cd2a9a61e89f9ae8cd'
AND (
token = '1uHqnKI2IInOUFJUAI+URej+yGkS+PJ7xEtDjGRlzTw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)