UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zVcHQkvgJjwR6T/Bfgb/j9mLRAHNYToIGFmjQ2lb8w4=' 
WHERE 
  key_id = 'f8ab043f32772fad853d242a244a8fe598d1558f06cd1e108f948e359ff2f9f3' 
  AND (
    token = 'zVcHQkvgJjwR6T/Bfgb/j9mLRAHNYToIGFmjQ2lb8w4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039