UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qlS+78X3GJQxTa6BBFePG2NCcSjqrw2cPe86IAFOj5o=' 
WHERE 
  key_id = '96f72f3384f00f23bc0a4a37b1d5ccab5bb2156222aab541263b7cf677e342d7' 
  AND (
    token = 'qlS+78X3GJQxTa6BBFePG2NCcSjqrw2cPe86IAFOj5o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030