UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lNiiqySIl6h8NLQiFzvp6jpD4wacpT2SLYShTdsXVRA=' 
WHERE 
  key_id = '8a1a856e4e71b393add0822c3049fd2e4129386d94578b1bc3cf120db2e6303a' 
  AND (
    token = 'lNiiqySIl6h8NLQiFzvp6jpD4wacpT2SLYShTdsXVRA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032