UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iZMDVS9zlbaZp8K8LieRtUau+Q/7R/VrFIXmZYYGvGY='
WHERE
key_id = 'ae553f5528b5544e30591cb65df0bde4c3ffa514748d6aa54017b1fd432ed4a1'
AND (
token = 'iZMDVS9zlbaZp8K8LieRtUau+Q/7R/VrFIXmZYYGvGY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)