UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OjYSU3uzeRyCQWIyw7nVs+QaYCmdlexO8LqCq7OZ3Mg='
WHERE
key_id = 'c31706d67536ee991b3a821efcce596977434096b1840fb1b382196ec0f5855b'
AND (
token = 'OjYSU3uzeRyCQWIyw7nVs+QaYCmdlexO8LqCq7OZ3Mg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)