UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pAOBHAmiw/k5kNrH0HfVNTqUXqHMagX4AY6GKo/N+1w='
WHERE
key_id = '6338d366702afcc174ab3567c9ecc2ffdc51812fd0e411e89e90a09bde8bf1ab'
AND (
token = 'pAOBHAmiw/k5kNrH0HfVNTqUXqHMagX4AY6GKo/N+1w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)