UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FG8z7Y/KauWk/9zQ9XqwSs8hsKhyLKzldHmSJ/xO35I=' 
WHERE 
  key_id = '37ca86543c5a42841c7fc0f2cca2d371f37f83e7e96eafc3e7fb009551d7c4a8' 
  AND (
    token = 'FG8z7Y/KauWk/9zQ9XqwSs8hsKhyLKzldHmSJ/xO35I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028