UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iLv6p2nNO98Q1GFwUthIlyJm4cbASAHR+M0wQ4CZrCk='
WHERE
key_id = '6515029d68dbd48a03b6a2defa6c0d23df51433fd633c20c62931cd14436fc70'
AND (
token = 'iLv6p2nNO98Q1GFwUthIlyJm4cbASAHR+M0wQ4CZrCk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)