UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/6iU9YDgBKbqiTj78DytfgsjeQ2nulrcR1RB07OnCkM='
WHERE
key_id = 'd3f075724742778ca49cd65165194e2d45fa2354bdfcb111abfec9e5d7ca3415'
AND (
token = '/6iU9YDgBKbqiTj78DytfgsjeQ2nulrcR1RB07OnCkM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)