UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3dZDsdJToMFOq8i3mwAqmHIfM2auiyGqPnpcKoTiTIY='
WHERE
key_id = 'fbb7f639450871c18a91414619184e2a23464d64bc98b90ecdb493bfdc24d179'
AND (
token = '3dZDsdJToMFOq8i3mwAqmHIfM2auiyGqPnpcKoTiTIY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)