UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6V4uJTimYVna1xKWvAg2ZO/kcHqweibLLSEoF65ELC4=' 
WHERE 
  key_id = '0f92b11e5ba715603a929e9be51e4a4041ad35884101b18f0365f950590a05cd' 
  AND (
    token = '6V4uJTimYVna1xKWvAg2ZO/kcHqweibLLSEoF65ELC4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026