UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'InIMI1ERdLBb3cNahQur7TLH0SZYtW+WS/y+XAnZ85Y='
WHERE
key_id = '37fa647861773d34ae4c6c9ebfb3f67616770a0203d51dd086e7ea96aff8c188'
AND (
token = 'InIMI1ERdLBb3cNahQur7TLH0SZYtW+WS/y+XAnZ85Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)