UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9ojDePyNtcmBcIhZ/umCxj0+RJvJ59oozgYOYGes6RQ='
WHERE
key_id = 'f853c521e6999e830d3ccf6edbeaeea85545c7ae6bd251324b297de84214bea5'
AND (
token = '9ojDePyNtcmBcIhZ/umCxj0+RJvJ59oozgYOYGes6RQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)