UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FxUnMhxp/S8Cu6jJHyTYSfRfsGCaCGZ3/CFvG+Ltkzg=' 
WHERE 
  key_id = 'dbf6c45ae5b459d98e3f141983c1f9327cd0043c536e41034f293008df58fd4c' 
  AND (
    token = 'FxUnMhxp/S8Cu6jJHyTYSfRfsGCaCGZ3/CFvG+Ltkzg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027