UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zeSDPwSIwE5TLFCFAr8DN9v+MOx14vlnoEJ7kBDAqc4='
WHERE
key_id = 'bc4ee00efb5cf61083785902edf592a2f1afbca68551685211203f0736e1fad6'
AND (
token = 'zeSDPwSIwE5TLFCFAr8DN9v+MOx14vlnoEJ7kBDAqc4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)