UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rON3kUTr8xhlFfI5KzNLqG17CitRKZyml8cCh7C7qJI='
WHERE
key_id = '818a862f051cffe47a109c386b7a07a9c3102f823ea906a66911f31be82332d9'
AND (
token = 'rON3kUTr8xhlFfI5KzNLqG17CitRKZyml8cCh7C7qJI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)