UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0moUbKNbFrn86ITgJFtA0DMw2lh7xmp/N3L0id27NOE='
WHERE
key_id = '5a9afebde1698973f6bd57ecfc58abc23fcfae71c0e4691184c3a29451f5218c'
AND (
token = '0moUbKNbFrn86ITgJFtA0DMw2lh7xmp/N3L0id27NOE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)