UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F4HAIJzfTVzB7oJ/IS7yt6CFRHbBsnukBHq2qGfgLBo='
WHERE
key_id = '0b53abdb869669d3dbf6134db804655fe63121514588b1368305307850eff6ed'
AND (
token = 'F4HAIJzfTVzB7oJ/IS7yt6CFRHbBsnukBHq2qGfgLBo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)