UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LPDOm70lfJNFSjGQTZluAhlFF8Z9/nJ4eln53GWa5ds='
WHERE
key_id = '74d196efe8ef30985d149659a2e578fdcfdaa78c182066733483e305f2a9fdea'
AND (
token = 'LPDOm70lfJNFSjGQTZluAhlFF8Z9/nJ4eln53GWa5ds='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)