UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Oe/rIVNnzCH+EdsukgYSurTN9zaXPEDJJ2F1Ce+6ZQ0=' 
WHERE 
  key_id = '19f6cc9db777d1134b1bbda1847de5d8e61d81bf3dcef8dc3eeb2281c4d260c0' 
  AND (
    token = 'Oe/rIVNnzCH+EdsukgYSurTN9zaXPEDJJ2F1Ce+6ZQ0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036