UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't72AVC4Febl4Ivm2SEXBEElnsYBY04k+/rIZCq6QH1k='
WHERE
key_id = '017772df23148771f394695152d82d2f59ae5f0d64d2a24068fc41db32854db1'
AND (
token = 't72AVC4Febl4Ivm2SEXBEElnsYBY04k+/rIZCq6QH1k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)