UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nwS3sgRbKGpKNreE3YloYEnyFyJxvJIRZrfZldkwbQo='
WHERE
key_id = 'a267f8c7146a823aa5dd15ac9c337bee991dce5a946386e5d3d64ab0225fa62c'
AND (
token = 'nwS3sgRbKGpKNreE3YloYEnyFyJxvJIRZrfZldkwbQo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)