UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/lXSxjFjNdXjYkANSAY4mAOF6uR2eoWV5eE458WO8S8='
WHERE
key_id = '942b9c08c76005401899023aa717c82d8bd20f44743ea091cb21ca23505badcc'
AND (
token = '/lXSxjFjNdXjYkANSAY4mAOF6uR2eoWV5eE458WO8S8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)