UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '45EL/V2uKsjuAccCSYkhgxLPLBEhE/WT4JiLOA5ogt4='
WHERE
key_id = 'f53bc0c700569509288811eaea1412318534d5a53e03ac648554c6307bc7d572'
AND (
token = '45EL/V2uKsjuAccCSYkhgxLPLBEhE/WT4JiLOA5ogt4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)