UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/hZA7hX3i6TChs17M6zqTJVDUiysmNBIXPTHFYu9p5s=' 
WHERE 
  key_id = 'd5e46d4c5697dfbad962873698cfdff74764f9b7e03798eaf851dfacd43d3215' 
  AND (
    token = '/hZA7hX3i6TChs17M6zqTJVDUiysmNBIXPTHFYu9p5s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044