UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RL901vIlTdxYLajytinP5hGLxK7tAW25sQUtHT1+DnI=' 
WHERE 
  key_id = '3ec15126650590d4e882618167c937b4b7f2d96694cbbbb32e28f70f0ce3f92a' 
  AND (
    token = 'RL901vIlTdxYLajytinP5hGLxK7tAW25sQUtHT1+DnI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018