UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0V+DGqtSbRq/nqcq874SOds8kSnQvKvmA+RdStdVITw='
WHERE
key_id = '5d47390e968c4f4f9706e21bd16208b1e52eabce18e453afb28312ab539c42c1'
AND (
token = '0V+DGqtSbRq/nqcq874SOds8kSnQvKvmA+RdStdVITw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)