UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'maXJaS+fZvV/zdOqBhjdwuGU1zKKZuw5EWd7NQpdGC4='
WHERE
key_id = '956f27e6b7f256b71b62a19d287ecb262764bc86a1381fefc0a4ae11f894a9c2'
AND (
token = 'maXJaS+fZvV/zdOqBhjdwuGU1zKKZuw5EWd7NQpdGC4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)