UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OpgnaJgGV6QZR2CvTMrDPKZRO/zy6XHyCJd/0wS8njU=' 
WHERE 
  key_id = '8f95ae90a388e56d2a350e8f2744076c92400fba6ead3e5dcd47bface9669b6b' 
  AND (
    token = 'OpgnaJgGV6QZR2CvTMrDPKZRO/zy6XHyCJd/0wS8njU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031