UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'O7TVx4jxqxiJlRDFoQhf2IntAFu+Sqj6cEBvMC1tWus=' 
WHERE 
  key_id = '71e0043df3765be3cc2bbe887abd5c4b5977237864d63a46204fcb2f41f4cc42' 
  AND (
    token = 'O7TVx4jxqxiJlRDFoQhf2IntAFu+Sqj6cEBvMC1tWus=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017